<template>
	<!-- 秀米 -->
	<el-dialog title="秀米图文消息助手"
	  class="dialogXiumi"
	  :visible.sync="xiumiVisible"
	  :append-to-body="true"
	  :before-close="handleClose">
	  <iframe class="xiumiIframe" src="script/ueditor-master/xiumi-ue-dialog-v5.html">
	  </iframe>
	</el-dialog>
</template>

<script>
	export default{
		data(){
			return{
				iframeUrl: '',
				xiumiHtml: '',
			}
		},
		props: ['xiumiVisible'],
		created() {
			this.iframeUrl = ''
		},
		methods:{
			handleClose() {
				this.$emit('closeDialog')
			},
			setXiumiHtml(event){
				this.$emit('insertImage',event.data.data)
				this.$emit('closeDialog')
			}
		},
		mounted() {
			window.addEventListener('message', this.setXiumiHtml);
		},
		watch:{
		}
	}
</script>

<style scoped="scoped">
	.dialogXiumi ::v-deep .el-dialog{
		width: 80%;
		margin-top: 6vh !important;
		height: 85%;
	}
	.xiumiIframe{
		width: 100%;
		height: 100%;
	}
	.dialogXiumi ::v-deep .el-dialog__body{
		height: calc(100% - 60px);
		padding: 0 5px 0 0 !important;
	}
</style>
